Skip to content

sumcheck cycle analysis #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: metrics/cycle_analysis
Choose a base branch
from

Conversation

kunxian-xia
Copy link

@kunxian-xia kunxian-xia commented May 22, 2025

Findings

writeup: https://hackmd.io/@ceno-zkvm/Hy0Vz8bMxl

1. Sumcheck

Simple fact (or main issue that we have): adding one variable alone will take 805 cycles!!

To see how many cycles it takes to verify a sumcheck proof with nv = 2, degree = 3, you can run the cmd

cargo test --release --features "bench-metrics" --lib test_simple_sumcheck -- --nocapture
nv cycles
1 997
2 1802
3 2607
4 3412
5 4217

1.1 Transcript

  1. To observe 3 extension elements(equivalent to 12 felts), it takes around 230 cycles. 230 is larger than 9*12 because of the overhead in processing "2-dimensional loop" / "ext2felts conversion". (issue 1)

  2. observe() takes 6 or 9 cycles.
    a. if inputs.len() = 7, it will need 9 cycles;
    b. otherwise, it will need 6 cycles.

  3. sample_ext: takes 62 cycles (62 = 43 + 19) where
    a. it called DuplexChallengerVariable.sample() by 4 times.
    b. it called ext_from_base_slice() by 1 time which takes 43 cycles. (issue 2)

1.2 Interpolation

issue 3

2. Solution

https://hackmd.io/@ceno-zkvm/Hy0Vz8bMxl#2-Solutions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant